#include "Branch.h"

using namespace std;

Branch::Branch(Node * Condition, Node * FirstBlock): condition(Condition)
{ blocks.push_back(FirstBlock); }

Branch::~Branch()
{
	delete(condition);
	for( vector<Node*>::iterator it = blocks.begin(); it != blocks.end(); it++ )
	{
		delete(*it);
	}
}

Node * Branch::getCondition() const
{ return condition; }

const std::vector<Node*> & Branch::getBlocks() const
{ return blocks; }

void Branch::addBlock(Node * block)
{
	blocks.push_back(block);
}

